package com.edu.neusoft.furniture_sale.service.impl;


import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.edu.neusoft.furniture_sale.dto.ProductsDto;
import com.edu.neusoft.furniture_sale.entity.Products;
import com.edu.neusoft.furniture_sale.mapper.ProductsMapper;
import com.edu.neusoft.furniture_sale.service.ProductsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.awt.print.Book;
import java.io.Serializable;
import java.util.List;

/**
 * 存储产品信息的表(Products)表服务实现类
 *
 * @author makejava
 * @since 2024-12-18 17:09:00
 */
@Service
public class ProductsServiceImpl extends ServiceImpl<ProductsMapper, Products> implements ProductsService {

    @Autowired
    private ProductsMapper productsMapper;

    @Override
    public List<Products> findByPage(int pageNum, int pageSize) {
        List<Products> productsList = productsMapper.selectByPage(pageNum, pageSize);
        // 处理productsList，如转换格式或添加额外逻辑
        return productsList;
    }

    @Override
    public ProductsDto selectByProductId(Integer productId) {
        ProductsDto products = productsMapper.selectByProductId(productId);
        return products;
    }
}

